<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
    
  
  <link href="//cdn.bootcss.com/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Intellij－IDEA," />








  <link rel="shortcut icon" type="image/x-icon" href="/uploads/favicon.ico?v=5.1.0" />






<meta name="description" content="前沿：　　工作开始就一直使用Intellij IDEA,从最初的10.0到现在的2017.1，Intellij IDEA陪我走过了五年时光，关于这款IDEA的小技巧，今天给大家科普一下。">
<meta property="og:type" content="article">
<meta property="og:title" content="你不知道的Intellij-IDEA">
<meta property="og:url" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/index.html">
<meta property="og:site_name" content="睿哥的技术博客">
<meta property="og:description" content="前沿：　　工作开始就一直使用Intellij IDEA,从最初的10.0到现在的2017.1，Intellij IDEA陪我走过了五年时光，关于这款IDEA的小技巧，今天给大家科普一下。">
<meta property="og:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/Intellij-IDEA.png">
<meta property="og:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/Tab.png">
<meta property="og:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/Ctrl-E.png">
<meta property="og:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/Ctrl-Shift-E.png">
<meta property="og:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/Ctrl-Shift-N.png">
<meta property="og:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/文件夹.png">
<meta property="og:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/Ctrl-Shift-Enter.gif">
<meta property="og:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/Hippie-Completion.gif">
<meta property="og:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/历史粘贴.png">
<meta property="og:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/JSON.gif">
<meta property="og:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/正则表达式.gif">
<meta property="og:updated_time" content="2017-04-01T03:29:29.394Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="你不知道的Intellij-IDEA">
<meta name="twitter:description" content="前沿：　　工作开始就一直使用Intellij IDEA,从最初的10.0到现在的2017.1，Intellij IDEA陪我走过了五年时光，关于这款IDEA的小技巧，今天给大家科普一下。">
<meta name="twitter:image" content="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/Intellij-IDEA.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/"/>





  <title> 你不知道的Intellij-IDEA | 睿哥的技术博客 </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  














  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">睿哥的技术博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocapitalize="off" autocomplete="off" autocorrect="off"
             placeholder="搜索..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2017/04/01/你不知道的Intellij-IDEA/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="睿哥">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/uploads/anan.JPG">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="睿哥的技术博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                你不知道的Intellij-IDEA
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-04-01T10:19:59+08:00">
                2017-04-01
              </time>
            

            

            
          </span>

          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a class="cloud-tie-join-count" href="/2017/04/01/你不知道的Intellij-IDEA/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count join-count" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          
             <span id="/2017/04/01/你不知道的Intellij-IDEA/" class="leancloud_visitors" data-flag-title="你不知道的Intellij-IDEA">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">阅读次数 </span>
               
                 <span class="leancloud-visitors-count"></span>
             </span>
          

          

          
            <div class="post-wordcount">
              
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计</span>
                
                <span title="字数统计">
                  718
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长</span>
                
                <span title="阅读时长">
                  3 min   
                </span>
              
            </div>
          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p><img src="/2017/04/01/你不知道的Intellij-IDEA/Intellij-IDEA.png" alt="Intellij-IDEA"></p>
<h2 id="前沿："><a href="#前沿：" class="headerlink" title="前沿："></a>前沿：</h2><p>　　工作开始就一直使用Intellij IDEA,从最初的10.0到现在的2017.1，Intellij IDEA陪我走过了五年时光，关于这款IDEA的小技巧，今天给大家科普一下。<br><a id="more"></a> </p>
<h2 id="正文："><a href="#正文：" class="headerlink" title="正文："></a>正文：</h2><blockquote>
<p>说明：本文是基于windows下Intellij IDEA-2016.3来编写的（2017.1我也是刚更新的）。如果看客使用的是其他版本或者快捷键，请各位自行脑补成你对应的快捷键。</p>
</blockquote>
<h3 id="关闭Intellij-IDEA的Tab页："><a href="#关闭Intellij-IDEA的Tab页：" class="headerlink" title="关闭Intellij IDEA的Tab页："></a>关闭Intellij IDEA的Tab页：</h3><p>　　为嘛要关闭Tab页呢，Tab页放在那里，当我们每次需要找文件的时候，都要去Tab页瞄一眼，这个瞄一眼，如果Tab页少的话还好说，Tab页多的话直接是眼睛看花的节奏，好吧就算Tab页比较少，你找到了，用鼠标点一下。这种操作效率极其低下，更加快捷的方式是直接关掉Tab页的功能:<br><img src="/2017/04/01/你不知道的Intellij-IDEA/Tab.png" alt=""><br>　　然后用<strong>Ctrl + E</strong>来找到最近访问的文件，<br><img src="/2017/04/01/你不知道的Intellij-IDEA/Ctrl-E.png" alt=""><br>　　或者直接用<strong>Ctrl + Shift + E</strong> 来访问最近编辑的文件，<br><img src="/2017/04/01/你不知道的Intellij-IDEA/Ctrl-Shift-E.png" alt=""><br>其实如果你记得文件名的话，用<strong>Ctrl + Shift + N</strong> 输入文件名是万金油的方法。<br><img src="/2017/04/01/你不知道的Intellij-IDEA/Ctrl-Shift-N.png" alt=""></p>
<h3 id="跳到特定的文件夹："><a href="#跳到特定的文件夹：" class="headerlink" title="跳到特定的文件夹："></a>跳到特定的文件夹：</h3><p>　　Intellij IDEA 和 Eclipse都有快速根据类名寻找类，或者根据资源名寻找资源的方式，但是我们想找一个文件夹，在Intellij IDEA里面，可以输入<strong>/文件夹名</strong>(使用Double Shift快捷键)，截图如下：<br><img src="/2017/04/01/你不知道的Intellij-IDEA/文件夹.png" alt=""></p>
<h3 id="快速补全行末分号："><a href="#快速补全行末分号：" class="headerlink" title="快速补全行末分号："></a>快速补全行末分号：</h3><p>　　Java中，每一个statement后面都要加上 ; 号，我们可以在行中任意位置使用快捷键 Ctrl + Shift + Enter 来快速补全分号：<br><img src="/2017/04/01/你不知道的Intellij-IDEA/Ctrl-Shift-Enter.gif" alt=""></p>
<h3 id="Hippie-Completion："><a href="#Hippie-Completion：" class="headerlink" title="Hippie Completion："></a>Hippie Completion：</h3><p>　　这种自动补全的模式，会选择当前编辑器中适合的单词直接拿过来补全：<br><img src="/2017/04/01/你不知道的Intellij-IDEA/Hippie-Completion.gif" alt=""></p>
<h3 id="粘贴版历史："><a href="#粘贴版历史：" class="headerlink" title="粘贴版历史："></a>粘贴版历史：</h3><p>　　在实际开发过程中，是不是会经常碰到这样的事情，2个页面的code需要互相替换一下，这时候一定在想粘贴板要是有历史功能就好了。其实 Intellij IDEA 里面也提供了这样的能力，我们可以直接通过 <strong>Ctrl + Shift + V</strong> 来进行访问历史粘贴板：<br><img src="/2017/04/01/你不知道的Intellij-IDEA/历史粘贴.png" alt=""></p>
<h3 id="Language-Injection："><a href="#Language-Injection：" class="headerlink" title="Language Injection："></a>Language Injection：</h3><p>　　大家都知道在 Java 的 String 中编辑有 JSON 的话有多麻烦，各种转义真是让人疯狂，在 Intellij IDEA 中，我们可以直接使用 Intellij IDEA 的 Language Injection 的功能（<strong>Alt + Enter</strong>）将一个字符串标记为 JSON，就可以非常方便地编写 JSON 了，再也不用担心转义的问题了：<br><img src="/2017/04/01/你不知道的Intellij-IDEA/JSON.gif" alt=""><br>　　当然，正则表达式也是支持的，甚至支持简单的正则表达式的测试能力：<br><img src="/2017/04/01/你不知道的Intellij-IDEA/正则表达式.gif" alt=""></p>
<h2 id="结束语："><a href="#结束语：" class="headerlink" title="结束语："></a>结束语：</h2><p>　　以上就是这次为大家分享的一些Intellij IDEA的使用小技巧，当然还有很多的小技巧等待你的发觉，还在犹豫是否加入Intellij IDEA 大家庭的伙伴们，赶紧到碗里来吧！</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="/images/WechatPay.png" alt="睿哥 WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="/images/AliPay.jpg" alt="睿哥 Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <div>
      
        

      
    </div>
	
	<div>
	  
    
<div style="text-align:center;color: #ccc;font-size:14px;">
------ 本文结束 ------</div>
<br/>
<div style="border:2px dashed black;box-shadow: 6px 6px 10px #ccc;">
<div style="margin-left:10px">
<span style="font-weight:blod">版权声明</span>
<img src="/images/copyright.jpg" >
<br/>
<p style="font-size: 10px;line-height: 30px;text-align: center"><a href="http://www.ruiger.club" style="color:#258FC6">睿哥的技术博客</a> by <a href="http://www.ruiger.club" style="color:#258FC6">Ruiger</a> is licensed under a <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" style="color:#258FC6">Creative Commons BY-NC-ND 4.0 International License</a>.<br/>
由<a href="http://www.ruiger.club" style="color:#258FC6">睿哥</a>创作并维护的<a href="http://www.ruiger.club" style="color:#258FC6">睿哥的技术博客</a>采用<a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" style="color:#258FC6">创作共用保留署名-非商业-禁止演绎4.0国际许可证</a>。<br/>
本文首发于<a href="http://www.ruiger.club" style="color:#258FC6">睿哥的技术博客</a> （ <a href="http://www.ruiger.club" style="color:#258FC6">http://www.ruiger.club</a> ），转载请注明出处，版权所有，侵权必究。</p>
</div>
</div>

  
	</div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Intellij－IDEA/" rel="tag"># Intellij－IDEA</a>
          
        </div>
      

      
        
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/03/31/Java 8十大特性/" rel="next" title="Java 8 十大特性">
                <i class="fa fa-chevron-left"></i> Java 8 十大特性
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        
  <script>
    window._bd_share_config = {
      "common": {
        "bdText": "",
        "bdMini": "1",
        "bdMiniList": false,
        "bdPic": ""
      },
      "image": {
        "viewList": ["tsina", "douban", "sqq", "qzone", "weixin", "twi", "fbook"],
        "viewText": "分享到：",
        "viewSize": "16"
      },
      "slide": {
        "bdImg": "5",
        "bdPos": "left",
        "bdTop": "100"
      }
    }
  </script>


<script>
  with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='//bdimg.share.baidu.com/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)];
</script>

      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="cloud-tie-wrapper" class="cloud-tie-wrapper"></div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/uploads/anan.JPG"
               alt="睿哥" />
          <p class="site-author-name" itemprop="name">睿哥</p>
           
              <p class="site-description motion-element" itemprop="description">重要的不是在哪混,而是跟谁混!</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">4</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">3</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/ruiger" target="_blank" title="Github">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  Github
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/2461168477" target="_blank" title="Weibo">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                  Weibo
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://wpa.qq.com/msgrd?v=3&uin=583260221&site=qq&menu=yes" target="_blank" title="QQ">
                  
                    <i class="fa fa-fw fa-qq"></i>
                  
                  QQ
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Links
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.ruiger.club" title="web project" target="_blank">web project</a>
                </li>
              
            </ul>
          </div>
        
		<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=2698075&auto=1&height=66"></iframe>

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#前沿："><span class="nav-number">1.</span> <span class="nav-text">前沿：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#正文："><span class="nav-number">2.</span> <span class="nav-text">正文：</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#关闭Intellij-IDEA的Tab页："><span class="nav-number">2.1.</span> <span class="nav-text">关闭Intellij IDEA的Tab页：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#跳到特定的文件夹："><span class="nav-number">2.2.</span> <span class="nav-text">跳到特定的文件夹：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#快速补全行末分号："><span class="nav-number">2.3.</span> <span class="nav-text">快速补全行末分号：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Hippie-Completion："><span class="nav-number">2.4.</span> <span class="nav-text">Hippie Completion：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#粘贴版历史："><span class="nav-number">2.5.</span> <span class="nav-text">粘贴版历史：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Language-Injection："><span class="nav-number">2.6.</span> <span class="nav-text">Language Injection：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#结束语："><span class="nav-number">3.</span> <span class="nav-text">结束语：</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">睿哥</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  






  
  <script type="text/javascript" src="//cdn.bootcss.com/jquery/2.1.3/jquery.min.js"></script>

  
  <script type="text/javascript" src="//cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js"></script>

  
  <script type="text/javascript" src="//cdn.bootcss.com/jquery_lazyload/1.9.7/jquery.lazyload.min.js"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="//cdn.bootcss.com/fancybox/2.1.5/jquery.fancybox.pack.js"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>




  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  


  




	





  
    
    <script>
      var cloudTieConfig = {
        url: document.location.href, 
        sourceId: "",
        productKey: "bdaec92c99554fa79e5d4503354edbef",
        target: "cloud-tie-wrapper"
      };
    </script>
    <script src="https://img1.ws.126.net/f2e/tie/yun/sdk/loader.js"></script>
  











  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length == 0) {
      search_path = "search.xml";
    }
    var path = "/" + search_path;
    // monitor main search box;

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.popup').toggle();
    }
    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';
      $.ajax({
        url: path,
        dataType: "xml",
        async: true,
        success: function( xmlResponse ) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = $( "entry", xmlResponse ).map(function() {
            return {
              title: $( "title", this ).text(),
              content: $("content",this).text(),
              url: $( "url" , this).text()
            };
          }).get();
          var $input = document.getElementById(search_id);
          var $resultContent = document.getElementById(content_id);
          $input.addEventListener('input', function(){
            var matchcounts = 0;
            var str='<ul class=\"search-result-list\">';
            var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
            $resultContent.innerHTML = "";
            if (this.value.trim().length > 1) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var content_index = [];
                var data_title = data.title.trim().toLowerCase();
                var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase();
                var data_url = decodeURIComponent(data.url);
                var index_title = -1;
                var index_content = -1;
                var first_occur = -1;
                // only match artiles with not empty titles and contents
                if(data_title != '') {
                  keywords.forEach(function(keyword, i) {
                    index_title = data_title.indexOf(keyword);
                    index_content = data_content.indexOf(keyword);
                    if( index_title >= 0 || index_content >= 0 ){
                      isMatch = true;
                      if (i == 0) {
                        first_occur = index_content;
                      }
                    }

                  });
                }
                // show search results
                if (isMatch) {
                  matchcounts += 1;
                  str += "<li><a href='"+ data_url +"' class='search-result-title'>"+ data_title +"</a>";
                  var content = data.content.trim().replace(/<[^>]+>/g,"");
                  if (first_occur >= 0) {
                    // cut out 100 characters
                    var start = first_occur - 20;
                    var end = first_occur + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if(start == 0){
                      end = 50;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    var match_content = content.substring(start, end);
                    // highlight all keywords
                    keywords.forEach(function(keyword){
                      var regS = new RegExp(keyword, "gi");
                      match_content = match_content.replace(regS, "<b class=\"search-keyword\">"+keyword+"</b>");
                    });

                    str += "<p class=\"search-result\">" + match_content +"...</p>"
                  }
                  str += "</li>";
                }
              })};
            str += "</ul>";
            if (matchcounts == 0) { str = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>' }
            if (keywords == "") { str = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>' }
            $resultContent.innerHTML = str;
          });
          proceedsearch();
        }
      });}

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched == false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(function(e){
      $('.popup').hide();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    });
    $('.popup').click(function(e){
      e.stopPropagation();
    });
  </script>





  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("jQD20aNekIhlWT6HC67gIK0D-gzGzoHsz", "wBnQ0cuJOCqHd80bJmgPPDp8");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  

  

  
  <a href="https://github.com/ruiger"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://camo.githubusercontent.com/8b6b8ccc6da3aa5722903da7b58eb5ab1081adee/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png"></a>

</body>
</html>
